package webservice;

import java.sql.*;
import java.util.*;

import dal.*;
import model.*;

public class CompanyWS {

	private Connection _dbConn = null;

	private Connection getDbConnection() throws SQLException,
			ClassNotFoundException {
		if (_dbConn == null) {
			_dbConn = ConnectionProvider.genConnection();
		}
		return _dbConn;
	}

	private GenericDal<CompanyModel, CompanyModelExt> _dal = null;

	private GenericDal<CompanyModel, CompanyModelExt> getDal()
			throws SQLException, ClassNotFoundException {
		if (_dal == null) {
			Connection dbConn = getDbConnection();
			_dal = new GenericDal<CompanyModel, CompanyModelExt>(
					new CompanyModel(), dbConn);
		}
		return _dal;
	}

//	public CompanyModel selectCompany(int[] ids) throws SQLException,
//			ClassNotFoundException {
//		GenericDal<CompanyModel, CompanyModelExt> dal = getDal();
//		CompanyModel model = (CompanyModel) dal.select(ids);
//		return model;
//	}
//
//	public CompanyModel[] selectListCompany(CompanyInput input)
//			throws SQLException {
//		List<CompanyModel> models = _dal.selectList(input);
//		CompanyModel[] result = (CompanyModel[]) models.toArray();
//		return result;
//	}

//	public int deleteCompany(int[] ids) throws SQLException {
//		int result = _dal.delete(ids);
//		return result;
//	}
//
//	public int countCompany(CompanyModelExt input) throws SQLException {
//		int count = _dal.count(input);
//		return count;
//	}

}